package com.chenye.logstash;


import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther:chenye
 * @Data:2018/6/27
 * @Description:
 */
public class Log4jTest {
//    public static final Logger logger = LoggerFactory.getLogger(Log4jTest.class);
    public static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Log4jTest.class);
    public static void main(String[] args){
        Map<String,Object> map = new HashMap();
        map.put("name","chenye");
        map.put("age","26");
        logger.error(JSONObject.toJSONString(map));
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
